package com.fa4j.system.settings.repository;

import com.fa4j.common.data.repository.BaseRepository;
import com.fa4j.system.settings.model.Dict;

import java.util.List;
import java.util.Optional;

/**
 * 系统字典 持久化接口实现
 *
 * @since 2025-06-12 16:58:22
 */
public interface DictRepository extends BaseRepository<Dict> {

    List<Dict> queryTreeByRootId(Integer rootId, Integer level);

    List<Dict> queryListByRootId(Integer rootId, Integer level);

    Optional<Dict> findByParentIdAndCode(Integer parentId, String dictCode);

    Long countByParentId(Integer parentId);

    List<Dict> queryByParentId(Integer parentId);

}
